\documentclass[12pt,onecolumn,titlepage]{article} 
\usepackage{azreport}

\usepackage{graphicx}
\usepackage{amssymb}
\usepackage[colorlinks=true,bookmarks=false,linkcolor=black,urlcolor=blue,citecolor=black]{hyperref}
\usepackage{url}
\usepackage{xspace}
\usepackage{subfigure}

\newcommand{\figureref}[1]{Fig.~\ref{#1}}
\newcommand{\tex}{\TeX\xspace}
\newcommand{\latex}{\LaTeX\xspace}
\newcommand{\miktex}{MiK\tex}
\newcommand{\wys}{\protect{WYSIWYG}\xspace}
\newcommand{\file}[1]{\texttt{#1}}
\newcommand{\cmd}[1]{\texttt{\%\ #1}\xspace}
\newcommand{\filename}{templateUniversal\xspace}

\begin{document}

\title{An Object-Oriented Approach to\\Candlestick Park ``The Game''}

\author[au1]{St. James the Less (jimbo@ece.arizona.edu)}

% the ~ prevents LaTeX from breaking a line, but inserts a space
\author[a2]{Peter von~Peterbon (email2@ece.arizona.edu)}

\author[au3]{Billy T.~Kid (email3@ece.arizona.edu)}

\course{ECE373--Object-Oriented Software Design}
\term{Fall 2007}
\faculty{Prof. Jonathan Sprinkle}
%\date{August 4, 2006}
\date{\today}

\maketitle

\section*{Executive Summary}
\addcontentsline{toc}{section}{Executive Summary}

This is a simple sample of a document created using \latex that includes a figure from the Vergil visual editor for Ptolemy II. It also provides an example to follow for the installation of figures so that either DVI/PS or PDF files can be generated using the appropriate command in \latex. Additionally, this file illustrates a simple two-column conference paper style, and use of bibtex to handle bibliographies. If you can compile this file in your \latex environment, then you should be able to create your own \tex documents for the project paper.


\include{project_overview}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%% Creating outputs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\begin{figure}[!b]
\begin{figure}[!ht]
  \begin{center}
    \includegraphics[width=1.0\columnwidth]{figure}
  \end{center}
  \caption{\small Figure caption. To get a figure to span two
      columns, use the environment figure* rather than figure.}
  \label{fig-label}
\end{figure}

% force a page return before going on to the next section
\newpage

\section{Creating DVI, PS, and PDF outputs from \latex Source}

This sample document will directly produce the DVI, PS, and PDF output formats from \latex sources, when compiled in conjunction with the \file{figure.ps} and \file{figure.eps} file.
To run \latex on this file, you need the following files:
\begin{enumerate}
\item \file{\filename.tex} (this file)
\item \file{figure.\{ps,pdf\}} (the appropriate figure file)
\item \file{simpleConference.sty} (style file)
\item \file{refs.bib} (bibiliography file)
\end{enumerate}

DVI and PS output both require a certain set of figure types---which unfortunately do not correspond to those for PDF output. This is explained in a following section. For the iterative writing of a paper, it can be useful to generate DVIs over and over, rather than PDFs, since they are very easy to view using previewers such as YAP (which ships with \miktex).

\subsection{Using an IDE}
IDEs such as TeXnicCenter \cite{texniccenter} are useful in reducing the amount of hacking required to produce a paper in \latex. These IDEs are usually a thin frame over the \tex execution, providing an editor (of varying capability) along with abilities to rapidly compile DVI/PS/PDF formats with little or no hassle, and generally doing the busywork of hooking in with the \tex implemenation (e.g., \miktex) in use on your computer.

While it is possible to create a \latex source file using vi or Emacs, if you are struggling (or new) in the world of *nix, or you generally prefer the look and feel of an IDE such as Visual Studio or Eclipse to do your regular run-of-the-mill programming, then you will appreciate \latex IDEs as well. Refer to their documentation for the finer points of \tex execution.

However, if you maintain a masochistic flair---or if you have access to a \latex installation only through a command line interface, such as a *nix server---please refer to the following section to learn how to use the command line interface for \latex execution.

\subsection{Using the command line}
An IDE takes care of the different kinds of formats that you might want to produce by actually executing the following commands. You can do these yourself (but with a greater likelihood of typo) by following these directions.

\subsubsection{Creating PDF output}
\label{PDF}
To create a PDF file, execute the following commands:
\begin{list}{}{}
\item \cmd{pdflatex \filename}
\item \cmd{bibtex \filename}
\item \cmd{pdflatex \filename}
\item \cmd{pdflatex \filename}
\end{list}
Yes (strangely) it is necessary to run pdflatex three times. The result will be a PDF file (plus several other files that \latex produces).  You will need a mechanism, of course, for executing commands on the command line. If you are using Windows, I recommend installing Cygwin and using its bash shell.

\subsubsection{Creating DVI output}
\label{DVI}
To create a PDF file, execute the following commands:
\begin{list}{}{}
\item \cmd{latex \filename}
\item \cmd{bibtex \filename}
\item \cmd{latex \filename}
\item \cmd{latex \filename}
\end{list}
As noted in Section \ref{PDF} it is necessary to run pdflatex three times. The result will be a DVI file (plus several other files that \latex produces) which renders as close to the actual print as required for basic proofreading. An advantage to generating a DVI (as opposed to a PDF) is that it generates faster, and using programs such as YAP, you can actually update the file while you have it open. This reduces your headache in recovering from ``Error: output file not writeable'' errors.

\subsubsection{Creating PS output}
To create a PS file, you must first create a DVI as explained in Section \ref{DVI}. Once this file is created, the next step is to run
\begin{list}{}{}
\item \cmd{dvips \filename.dvi}
\end{list}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%% Using Figures
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Using Figures}
When generating PS and DVI outputs, the most popular image format is EPS (Embedded PostScript). This format is easily obtained by printing to a file on a PostScript printer, and setting the bounding box of the graphic using a tool such as GhostView. PDF output is unfortunately unable to use EPS as a source for images; its most common image format is PDF.

The question then arises: are you forced, at the writing of a document, to decide whether you want your final output to be PDF or PS? The answer is: yes (if you want to), and no (if you are clever).

Actually, it is \latex that is clever when it comes to this, and rightly so, since it is \latex that created this problem in the first place by not creating a way for multiple image formats to be used by the same output formats. It turns out that if you include your images without an extension, that the commands will figure out which images to use based on whether they are generating PDF or DVI formats.

For example, this document uses the file shown in \figureref{fig-label}. When generating the output with the command \texttt{latex}, \latex looks for a file called \file{figure.EPS}, \file{figure.PS}, \dots until it finds something it can use. If nothing is found, then it sends an  error. When generating using the command \texttt{pdflatex}, \latex looks for a file called \file{figure.PDF}, \dots until it finds something it can use.

This allows you to have one file for your source, and then maintain two copies of each image (or generating the final set of images when you produce a PDF at the end). An alternative is to \emph{never} use pdflatex, and instead produce a PDF from your PS output (that you created from your DVI). However, this requires software not shipped with \miktex (such as Adobe Distiller), so you may wish to perform your document preperation in whichever way costs you the least amount of licensing fees.

\begin{verbatim}
\begin{figure}[!b] 
 \begin{center} 
   \includegraphics
   	[width=1.0\columnwidth]{figure} 
 \end{center} 
 \caption{\small Figure caption. 
 	To get a figure to span two 
  columns, use the environment 
  figure* rather than figure.} 
 \label{fig-label} 
\end{figure} 
\end{verbatim}

\subsection{How to Include Vergil Diagrams as Figures}

Suppose you wish to include a figure, like that in figure \ref{fig-label}.
The simplest mechanism is to install Adobe Acrobat, which includes
a ``printer'' called ``Acrobat Distiller.'' Printing to this printer
creates a PDF file, which can be included in a document as shown
here.  To include Ptolemy II models \cite{PtolemyVol1:04},
just print to the distiller from within Vergil and reference
the PDF file in your \latex document.

There is a bit more work to do, however.
The file that is produced by the distiller represents
a complete page, not the individual figure.
You can open it in using Acrobat (version 5.0 or later),
and select Document $\rightarrow$ Crop Pages from the menu.
In the resulting dialog, check ``Remove White Margins.''
Save the modified PDF file in a file and then reference
it in the \latex file as shown in this example.

\begin{figure}[htbp]
	\centering
%		\includegraphics[scale=1]{file}
	\subfigure[This is the caption for my subfigure]
	{
		\label{fig:subfigure1}
		\includegraphics[width=0.4\columnwidth]{figure}
	}
	% put space between these two figures
	\hfill
	\subfigure[This is the caption for my subfigure]
	{
		\label{fig:subfigure2}
		\includegraphics[width=0.3\columnwidth]{figure}
	}
	\\
	\hfill
	\subfigure[This is the caption for my subfigure]
	{
		\label{fig:subfigure3}
		\includegraphics[width=0.3\columnwidth]{figure}
	}
	\hfill
	\subfigure[This is the caption for my subfigure]
	{
		\label{fig:subfigure4}
		\includegraphics[width=0.3\columnwidth]{figure}
	}
	\hfill\hfill
	\caption{Here are my two subfigures (see Figure \ref{fig:subfigure1}, and Figure \ref{fig:subfigure2}).}
	\label{fig:label}
\end{figure}

An alternative is to generate EPS (encapsulated postscript). This is done by printint to any PostScript printer as a file, and saving the file with extension EPS. Then you must set the bounding box (as described in the webpage instructions).

\subsection{How to Create EPS Figures from EMF/WMF}
Windows Metafiles and Enhanced Metafiles are the Windows version of EPS format. This means that they are stored in a terse format that is not subject to pixellation errors when it is rescaled. This also means that any text in the EMF/WMF format is stored logically with a ``pointer'' to the font implementation (the implication of this is that the image will not look the same if viewed on another computer that does not have that font).

EMF/WMF images are easily created from Microsoft drawing packages such as PowerPoint and Visio, and is usually an available format for pasting images from the clipboard. For directions on creating EPS figures (which can be used by \latex) from EMF/WMF files, please see the instructions on \url{http://www.eecs.berkeley.edu/~sprinkle/useful/latex}.

\begin{figure}[!ht]
	\centering
		\includegraphics[width=0.5\textwidth]{figure}
	\caption{This is my sweet caption, dood.}
	\label{fig:the_last_label}
\end{figure}

\begin{table}
	\centering
\begin{tabular}{cccc}
\hline
-- & ALCS Champions & NLCS Champions & DH Losers\\
\hline
1999 & Yankees & Cleveland Indians & Cubs\\
\hline
2000 & r3c2 & r3c3 & r3c4\\
\hline
r4c1 & r4c2 & r4c3 & r4c4\\
\hline
r5c1 & r5c2 & r5c3 & r5c4\\
\hline
\end{tabular}
\caption{The teacher shows his ignorance of bezball.}
\label{tab:baseball}
\end{table}

\begin{table}
	\begin{center}
		\includegraphics[width=0.9\textwidth]{figure}
	\end{center}
	\caption{Doesn't this look like a table to you??}
	\label{tab:thefaketable}
\end{table}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%% Conclusion
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Conclusion}
This document should give you some idea of how to create documents for your final project in EE 290N, as well as providing a basic primer for common commands that you might use when writing a \latex document. Please examine the source before approaching with questions, since the source actually produces the file that you read (i.e., if you see a pattern in the final PDF that you want to recreate, the instructor will look in the source to see how to do it, which you can do yourself).

Good luck in creating your files, and start early!!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%% Acknowledgements (un-numbered...)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section*{Acknowledgements}
Thanks to Google.com, which provided most of my knowledge on \latex. You can also see the Kopka book \cite{guideToLatex} which is where most of my historical and introductory information came from.

\bibliographystyle{abbrv}
\bibliography{refs}
\end{document}
